#include "led.h"

#define PIN_COUNT 4

static const en_pin_t pinTable[PIN_COUNT] = {
    LED_R1_PIN,
    LED_R2_PIN,
    LED_G1_PIN,
    LED_G2_PIN
};

static const en_port_t portTabal[PIN_COUNT] = {
    LED_R1_PORT,
    LED_R2_PORT,
    LED_G1_PORT,
    LED_G2_PORT
};

void ledInit(void)
{
    stc_port_init_t stcPortInit;
    MEM_ZERO_STRUCT(stcPortInit);
    stcPortInit.enPinMode = Pin_Mode_Out;
    for (uint8_t i = 0; i < PIN_COUNT; i++)
    {
        PORT_Init(portTabal[i], pinTable[i], &stcPortInit);
    }
    LED_ON(1,R);
    LED_ON(2,R);
    LED_ON(1,G);
    LED_ON(2,G);
}
